﻿<Page
    x:Class="TipCalculator.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TipCalculator"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="100" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBlock Margin="20, 0, 20, 0" 
                   Grid.Row="0" 
                   Style="{StaticResource TitleTextBlockStyle}">
            Tip Calculator
        </TextBlock>

        <TextBlock Margin="20, 0, 20, 0" 
                   Grid.Row="1" 
                   Style="{StaticResource TitleTextBlockStyle}" 
                   FontSize="48">
            Enter the Bill Amount
        </TextBlock>


        <StackPanel Name="myStackPanel" Grid.Row="2" Margin="20, 0, 20, 0">

            <TextBlock HorizontalAlignment="Left" 
                   TextWrapping="Wrap" 
                   Text="Bill Amount"
                    FontSize="24"/>

            <TextBox Name="billAmountTextBox" 
                     Text="0.00"
                     TextAlignment="Right"
                     HorizontalAlignment="Left" 
                     TextWrapping="Wrap" 
                     VerticalAlignment="Top" 
                     InputScope="Number"
                     Width="100"
                     FontSize="24" 
                     LostFocus="amountTextBox_LostFocus" 
                     TextChanged="billAmountTextBox_TextChanged" 
                     GotFocus="amountTextBox_GotFocus" />


            <TextBlock HorizontalAlignment="Left" 
                       TextWrapping="Wrap" 
                       Text="Percent To Tip:" 
                       VerticalAlignment="Top"
                       FontSize="24"
                       Margin="0,20,0,0"/>

            <RadioButton Content="10% - Horrible Service" 
                         Tag="0.1" 
                         GroupName="percentRadio" 
                         Click="RadioButton_Click" />

            <RadioButton Content="18% - Acceptable Service" 
                         Tag="0.18" 
                         GroupName="percentRadio" 
                         IsChecked="True" 
                         Click="RadioButton_Click" />

            <RadioButton Content="25% - Great Service" 
                         Tag="0.25" 
                         GroupName="percentRadio" 
                         Click="RadioButton_Click" />

            <TextBlock HorizontalAlignment="Left" 
                   TextWrapping="Wrap" 
                   Text="Amount to Tip:"
                   FontSize="24"
                   Margin="0,20,0,0"
                   />

            <TextBlock Name="amountToTipTextBlock" 
                       HorizontalAlignment="Left" 
                   TextWrapping="Wrap" 
                   VerticalAlignment="Top"
                   Text="$0.00"
                    FontSize="36"
                   />

            <TextBlock HorizontalAlignment="Left" 
                   TextWrapping="Wrap" 
                   VerticalAlignment="Top"
                   Text="Total Bill:"
                       FontSize="24"
                       Margin="0,20,0,0"
                   />

            <TextBlock x:Name="totalTextBlock" 
                   HorizontalAlignment="Left" 
                   TextWrapping="Wrap" 
                   VerticalAlignment="Top"
                   Text="$0.00"
                       FontSize="36"                       
                   />
        </StackPanel>
    </Grid>
</Page>
